﻿/*
 * Created by SharpDevelop.
 * Author: Taranu Bogdan
 * Date: 5/4/2012
 * Time: 12:54 AM
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServerClientCommon
{
    /// <summary>
    /// A preset for "normal" sensors. A preset can be used
    /// to modify the scale values at raw-to-real conversion
    /// time.
    /// </summary>
    public class NormalSensorsPreset
    {
        #region Constants
        /// <summary>
        /// The lower limit of the ECG real value
        /// </summary>
        private const int ECG_LOWER_LIMIT = -50;
        /// <summary>
        /// The upper limit of the ECG real value
        /// </summary>
        private const int ECG_UPPER_LIMIT = 150;
        /// <summary>
        /// The lower limit of the HTA real value
        /// </summary>
        private const int HTA_LOWER_LIMIT = 20;
        /// <summary>
        /// The upper limit of the HTA real value
        /// </summary>
        private const int HTA_UPPER_LIMIT = 300;
        /// <summary>
        /// The lower limit of the body temperature integer real value
        /// </summary>
        private const int BODY_TEMPERATURE_LOWER_LIMIT = 30;
        /// <summary>
        /// The upper limit of the body temperature integer real value
        /// </summary>
        private const int BODY_TEMPERATURE_UPPER_LIMIT = 43;
        /// <summary>
        /// The lower limit of the pulse real value
        /// </summary>
        private const int PULSE_LOWER_LIMIT = 40;
        /// <summary>
        /// The upper limit of the pulse real value
        /// </summary>
        private const int PULSE_UPPER_LIMIT = 200;
        /// <summary>
        /// The lower limit of the weight real value
        /// </summary>
        private const int WEIGHT_LOWER_LIMIT = 30;
        /// <summary>
        /// The upper limit of the weight real value
        /// </summary>
        private const int WEIGHT_UPPER_LIMIT = 300;
        /// <summary>
        /// The lower limit of the glicemia real value
        /// </summary>
        private const int GLICEMIA_LOWER_LIMIT = 10;
        /// <summary>
        /// The upper limit of the glicemia real value
        /// </summary>
        private const int GLICEMIA_UPPER_LIMIT = 400;
        /// <summary>
        /// The lower limit of the respiratory frequency real value
        /// </summary>
        private const int RESPIRATORY_FREQUENCY_LOWER_LIMIT = 5;
        /// <summary>
        /// The upper limit of the respiratory frequency real value
        /// </summary>
        private const int RESPIRATORY_FREQUENCY_UPPER_LIMIT = 40;
        /// <summary>
        /// The lower limit of the ambient temperature real value
        /// </summary>
        private const int AMBIENT_TEMPERATURE_LOWER_LIMIT = -5;
        /// <summary>
        /// The upper limit of the ambient temperature real value
        /// </summary>
        private const int AMBIENT_TEMPERATURE_UPPER_LIMIT = 90;
        #endregion

        #region Members
        /// <summary>
        /// The lower limit of the ECG real value
        /// </summary>
        private int ecgLowerLimit;
        /// <summary>
        /// The upper limit of the ECG real value
        /// </summary>
        private int ecgUpperLimit;
        /// <summary>
        /// The lower limit of the HTA real value
        /// </summary>
        private int htaLowerLimit;
        /// <summary>
        /// The upper limit of the HTA real value
        /// </summary>
        private int htaUpperLimit;
        /// <summary>
        /// The lower limit of the body temperature integer real value
        /// </summary>
        private int bodyTemperatureLowerLimit;
        /// <summary>
        /// The upper limit of the body temperature integer real value
        /// </summary>
        private int bodyTemperatureUpperLimit;
        /// <summary>
        /// The lower limit of the pulse real value
        /// </summary>
        private int pulseLowerLimit;
        /// <summary>
        /// The upper limit of the pulse real value
        /// </summary>
        private int pulseUpperLimit;
        /// <summary>
        /// The lower limit of the weight real value
        /// </summary>
        private int weightLowerLimit;
        /// <summary>
        /// The upper limit of the weight real value
        /// </summary>
        private int weightUpperLimit;
        /// <summary>
        /// The lower limit of the glicemia real value
        /// </summary>
        private int glicemiaLowerLimit;
        /// <summary>
        /// The upper limit of the glicemia real value
        /// </summary>
        private int glicemiaUpperLimit;
        /// <summary>
        /// The lower limit of the respiratory frequency real value
        /// </summary>
        private int respiratoryFrequencyLowerLimit;
        /// <summary>
        /// The upper limit of the respiratory frequency real value
        /// </summary>
        private int respiratoryFrequenctUpperLimit;
        /// <summary>
        /// The lower limit of the ambient temperature real value
        /// </summary>
        private int ambientTemperatureLowerLimit;
        /// <summary>
        /// The upper limit of the ambient temperature real value
        /// </summary>
        private int ambientTemperatureUpperLimit;
        #endregion

        #region Properties
        /// <summary>
        /// Gets or sets the ECG lower limit
        /// </summary>
        public int EcgLowerLimit
        {
            get { return ecgLowerLimit; }
            set { ecgLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the ECG upper limit
        /// </summary>
        public int EcgUpperLimit
        {
            get { return ecgUpperLimit; }
            set { ecgUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the HTA lower limit
        /// </summary>
        public int HtaLowerLimit
        {
            get { return htaLowerLimit; }
            set { htaLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the HTA upper limit
        /// </summary>
        public int HtaUpperLimit
        {
            get { return htaUpperLimit; }
            set { htaUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the body temperature lower limit
        /// </summary>
        public int BodyTemperatureLowerLimit
        {
            get { return bodyTemperatureLowerLimit; }
            set { bodyTemperatureLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the body temperature upper limit
        /// </summary>
        public int BodyTemperatureUpperLimit
        {
            get { return bodyTemperatureUpperLimit; }
            set { bodyTemperatureUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the pulse lower limit
        /// </summary>
        public int PulseLowerLimit
        {
            get { return pulseLowerLimit; }
            set { pulseLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the ECG upper limit
        /// </summary>
        public int PulseUpperLimit
        {
            get { return pulseUpperLimit; }
            set { pulseUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the weight lower limit
        /// </summary>
        public int WeightLowerLimit
        {
            get { return weightLowerLimit; }
            set { weightLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the weight upper limit
        /// </summary>
        public int WeightUpperLimit
        {
            get { return weightUpperLimit; }
            set { weightUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the glicemia lower limit
        /// </summary>
        public int GlicemiaLowerLimit
        {
            get { return glicemiaLowerLimit; }
            set { glicemiaLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the glicemia upper limit
        /// </summary>
        public int GlicemiaUpperLimit
        {
            get { return glicemiaUpperLimit; }
            set { glicemiaUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the respiratory frequency lower limit
        /// </summary>
        public int RespiratoryFrequencyLowerLimit
        {
            get { return respiratoryFrequencyLowerLimit; }
            set { respiratoryFrequencyLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the respiratory frequency upper limit
        /// </summary>
        public int RespiratoryFrequenctUpperLimit
        {
            get { return respiratoryFrequenctUpperLimit; }
            set { respiratoryFrequenctUpperLimit = value; }
        }
        /// <summary>
        /// Gets or sets the ambient temperature lower limit
        /// </summary>
        public int AmbientTemperatureLowerLimit
        {
            get { return ambientTemperatureLowerLimit; }
            set { ambientTemperatureLowerLimit = value; }
        }
        /// <summary>
        /// Gets or sets the ambient temperature upper limit
        /// </summary>
        public int AmbientTemperatureUpperLimit
        {
            get { return ambientTemperatureUpperLimit; }
            set { ambientTemperatureUpperLimit = value; }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Creates a PackageFactory object according to specified limits
        /// </summary>
        /// <param name="ecgLowerLimit">Lowest ECG value possible</param>
        /// <param name="ecgUpperLimit">Highest ECG value possible</param>
        /// <param name="htaLowerLimit">Lowest HTA value possible</param>
        /// <param name="htaUpperLimit">Highest HTA value possible</param>
        /// <param name="bodyTemperatureLowerLimit">Lowest body temperature value possible</param>
        /// <param name="bodyTemperatureUpperLimit">Highest body temperature value possible</param>
        /// <param name="pulseLowerLimit">Lowest pulse value possible</param>
        /// <param name="pulseUpperLimit">Highest pulse value possible</param>
        /// <param name="weightLowerLimit">Lowest weight value possible</param>
        /// <param name="weightUpperLimit">Highest pulse value possible</param>
        /// <param name="glicemiaLowerLimit">Lowest glicemia value possible</param>
        /// <param name="glicemiaUpperLimit">Highest glicemia value possible</param>
        /// <param name="respiratoryFrequencyLowerLimit">Lowest respiratory frequency value possible</param>
        /// <param name="respiratoryFrequencyUpperLimit">Highest respiratory frequency value possible</param>
        /// <param name="ambientTemperatureLowerLimit">Lowest ambient temperature value possible</param>
        /// <param name="ambientTemperatureUpperLimit">Highest ambient temperature value possible</param>
        public NormalSensorsPreset(int ecgLowerLimit, int ecgUpperLimit,
                                  int htaLowerLimit, int htaUpperLimit,
                                  int bodyTemperatureLowerLimit, int bodyTemperatureUpperLimit,
                                  int pulseLowerLimit, int pulseUpperLimit,
                                  int weightLowerLimit, int weightUpperLimit,
                                  int glicemiaLowerLimit, int glicemiaUpperLimit,
                                  int respiratoryFrequencyLowerLimit, int respiratoryFrequencyUpperLimit,
                                  int ambientTemperatureLowerLimit, int ambientTemperatureUpperLimit)
        {
            this.ecgLowerLimit = ecgLowerLimit;
            this.ecgUpperLimit = ecgUpperLimit;
            this.htaLowerLimit = htaLowerLimit;
            this.htaUpperLimit = htaUpperLimit;
            this.bodyTemperatureLowerLimit = bodyTemperatureLowerLimit;
            this.bodyTemperatureUpperLimit = bodyTemperatureUpperLimit;
            this.pulseLowerLimit = pulseLowerLimit;
            this.pulseUpperLimit = pulseUpperLimit;
            this.weightLowerLimit = weightLowerLimit;
            this.weightUpperLimit = weightUpperLimit;
            this.glicemiaLowerLimit = glicemiaLowerLimit;
            this.glicemiaUpperLimit = glicemiaUpperLimit;
            this.respiratoryFrequencyLowerLimit = respiratoryFrequencyLowerLimit;
            this.respiratoryFrequenctUpperLimit = respiratoryFrequencyUpperLimit;
            this.ambientTemperatureLowerLimit = ambientTemperatureLowerLimit;
            this.ambientTemperatureUpperLimit = ambientTemperatureUpperLimit;
        }

        /// <summary>
        /// Creates a preset according to the default values
        /// </summary>
        public NormalSensorsPreset()
            : this(ECG_LOWER_LIMIT, ECG_UPPER_LIMIT, HTA_LOWER_LIMIT, HTA_UPPER_LIMIT,
                  BODY_TEMPERATURE_LOWER_LIMIT, BODY_TEMPERATURE_UPPER_LIMIT,
                  PULSE_LOWER_LIMIT, PULSE_UPPER_LIMIT,
                  WEIGHT_LOWER_LIMIT, WEIGHT_UPPER_LIMIT,
                  GLICEMIA_LOWER_LIMIT, GLICEMIA_UPPER_LIMIT,
                  RESPIRATORY_FREQUENCY_LOWER_LIMIT, RESPIRATORY_FREQUENCY_UPPER_LIMIT,
                  AMBIENT_TEMPERATURE_LOWER_LIMIT, AMBIENT_TEMPERATURE_UPPER_LIMIT)
        {

        }
        #endregion

    }
}
